using System.Collections;
using System.Collections.Generic;
using UIFramework;
using UnityEngine;
using UnityEngine.UI;

public class MainView : BaseView
{
    public class MainContext : BaseContext
    {
        public MainContext() : base(UIType.MainView) { }
    }

    public Button contentBtn;
    public Button deviceBtn;

    public override void OnEnter(BaseContext context)
    {
        this.gameObject.SetActive(true);
        base.OnEnter(context);

        InitEvent();
    }
    public override void OnExit(BaseContext context)
    {
        base.OnExit(context);
    }

    private void InitEvent()
    {
        contentBtn.onClick.AddListener(() => {
            Singleton<ContextManager>.Instance.Pop();
            Singleton<ContextManager>.Instance.Push(new ContentView.ContentContext());
        });
        deviceBtn.onClick.AddListener(() => {  
            Singleton<ContextManager>.Instance.Pop();
            Singleton<ContextManager>.Instance.Push(new DevicePanel.DeviceContext());
        });
    }
}
